import { BasicColumn, FormSchema } from '@apps/antd-admin/src/components/Table';
import {render} from "@apps/antd-admin/src/hooks/render/renderUtils";
import {RenderType} from '@pkg/setting';
import {Api} from "./api";
export const columns: BasicColumn[] = [
  {
    title: '期刊名称',
    dataIndex: 'journalTitle',
    width: 150,
  },
  {
    title: '封面图',
    dataIndex: 'coverImage',
    width: 70,
    customRender: render.renderImage,
  },
  {
    title: '发布状态',
    dataIndex: 'state',
    width: 100,
    rowKey: 'journalId',
    renderApi: Api.setState,
    customRender: render.renderSwitch,
  },
  {
    title: '创建时间',
    dataIndex: 'createTime',
    width: 150,
  },
];

export const searchFormSchema: FormSchema[] = [
  {
    field: 'journalTitle',
    label: '期刊名称',
    component: 'Input',
    colProps: { span: 3 },
  },
];

export const formSchema: FormSchema[] = [
  {
    label: '',
    field: 'journalId',
    component: 'Input',
    show: false,
  },
  {
    label: '期刊名称',
    field: 'journalTitle',
    component: 'Input',
    required: true,
  },
  {
    label: '封面图',
    field: 'coverImage',
    component: 'ImageUpload',

    itemProps:{
      extra:"建议尺寸335*440",
    },
    required: true
  },
];
